/*
 * $Id: DirectionsRoute.java 42 2013-04-17 15:33:59Z gabakyan $
 * $Author: gabakyan $
 * $Revision: 42 $
 * $Date: 2013-04-17 15:33:59 +0000 (Wed, 17 Apr 2013) $
 *
 * Copyright (c) 2013 Supply Chain Intelligence (SCI), Inc.
 * http://www.scintelligence.com/, Email: info@scintelligence.com
 * All rights reserved.
 *
 * This file is part of Logistics Map.
 *
 * Logistics Map is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * Logistics Map is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Logistics Map.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.sci.logisticsmap.support.model.geocoding;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * The interface {@code DirectionsRoute} represents the geocoding directions route.
 *
 * @author gabakyan@gmail.com (Last modified by $Author: gabakyan $)
 * @version $Revision: 42 $
 */
public class DirectionsRoute implements Serializable {
    /**
     * The serial version id.
     */
    private static final long serialVersionUID = 1L;

    /**
     * The summary.
     */
    private String summary;
    /**
     * The legs.
     */
    private List<DirectionsLeg> legs;
    /**
     * The copyrights.
     */
    private String copyrights;
    //"overview_polyline": {
    //        "points": "a~l~Fjk~uOnzh@vlbBtc~@tsE`vnApw{A`dw@~w\\|tNtqf@l{Yd_Fblh@rxo@b}@xxSfytAblk@xxaBeJxlcBb~t@zbh@jc|Bx}C`rv@rw|@rlhA~dVzeo@vrSnc}Axf]fjz@xfFbw~@dz{A~d{A|zOxbrBbdUvpo@`cFp~xBc`Hk@nurDznmFfwMbwz@bbl@lq~@loPpxq@bw_@v|{CbtY~jGqeMb{iF|n\\~mbDzeVh_Wr|Efc\\x`Ij{kE}mAb~uF{cNd}xBjp]fulBiwJpgg@|kHntyArpb@bijCk_Kv~eGyqTj_|@`uV`k|DcsNdwxAott@r}q@_gc@nu`CnvHx`k@dse@j|p@zpiAp|gEicy@`omFvaErfo@igQxnlApqGze~AsyRzrjAb__@ftyB}pIlo_BflmA~yQftNboWzoAlzp@mz`@|}_@fda@jakEitAn{fB_a]lexClshBtmqAdmY_hLxiZd~XtaBndgC"
    //}
    /**
     * The warnings.
     */
    private List<String> warnings;
    /**
     * The waypoint order.
     */
    private int[] waypointOrder;
    /**
     * The bounds.
     */
    private LatLngBounds bounds;

    /**
     * Gets the summary.
     *
     * @return The summary.
     */
    public String getSummary() {
        return summary;
    }

    /**
     * Sets the summary.
     *
     * @param summary The summary.
     */
    public void setSummary(String summary) {
        this.summary = summary;
    }

    /**
     * Gets the legs.
     *
     * @return The legs.
     */
    public List<DirectionsLeg> getLegs() {
        return legs;
    }

    /**
     * Sets the legs.
     *
     * @param legs The legs.
     */
    public void setLegs(List<DirectionsLeg> legs) {
        this.legs = legs;
    }

    /**
     * Gets the copyrights.
     *
     * @return The copyrights.
     */
    public String getCopyrights() {
        return copyrights;
    }

    /**
     * Sets the copyrights.
     *
     * @param copyrights The copyrights.
     */
    public void setCopyrights(String copyrights) {
        this.copyrights = copyrights;
    }

    /**
     * Gets the warnings.
     *
     * @return The warnings.
     */
    public List<String> getWarnings() {
        return warnings;
    }

    /**
     * Sets the warnings.
     *
     * @param warnings The warnings.
     */
    public void setWarnings(List<String> warnings) {
        this.warnings = warnings;
    }

    /**
     * Gets the waypoint order.
     *
     * @return The waypoint order.
     */
    public int[] getWaypointOrder() {
        return waypointOrder;
    }

    /**
     * Sets the waypoint order.
     *
     * @param waypointOrder The waypoint order.
     */
    public void setWaypointOrder(int[] waypointOrder) {
        this.waypointOrder = waypointOrder;
    }

    /**
     * Gets the bounds.
     *
     * @return The bounds.
     */
    public LatLngBounds getBounds() {
        return bounds;
    }

    /**
     * Sets the bounds.
     *
     * @param bounds The bounds.
     */
    public void setBounds(LatLngBounds bounds) {
        this.bounds = bounds;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DirectionsRoute that = (DirectionsRoute) o;

        if (bounds != null ? !bounds.equals(that.bounds) : that.bounds != null) return false;
        if (copyrights != null ? !copyrights.equals(that.copyrights) : that.copyrights != null) return false;
        if (legs != null ? !legs.equals(that.legs) : that.legs != null) return false;
        if (summary != null ? !summary.equals(that.summary) : that.summary != null) return false;
        if (warnings != null ? !warnings.equals(that.warnings) : that.warnings != null) return false;
        if (!Arrays.equals(waypointOrder, that.waypointOrder)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = summary != null ? summary.hashCode() : 0;
        result = 31 * result + (legs != null ? legs.hashCode() : 0);
        result = 31 * result + (copyrights != null ? copyrights.hashCode() : 0);
        result = 31 * result + (warnings != null ? warnings.hashCode() : 0);
        result = 31 * result + (waypointOrder != null ? Arrays.hashCode(waypointOrder) : 0);
        result = 31 * result + (bounds != null ? bounds.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "DirectionsRoute{" +
                "summary='" + summary + '\'' +
                ", legs=" + legs +
                ", copyrights='" + copyrights + '\'' +
                ", warnings=" + warnings +
                ", waypointOrder=" + waypointOrder +
                ", bounds=" + bounds +
                '}';
    }
}
